import Mock from 'mockjs'

const data = Mock.mock({
  // 'items|30': [{
  //   id: '@id',
  //   name: '@sentence(10, 20)',
  //   pname: 'name',
  //   date: '@datetime',
  // }],
  'page':{
    total:"@integer(60, 100)",
    'items|20': [{
      id: '@integer(1, 100)',
      name: '@cword(2, 5)',
      pname: '@cword(2, 5)',
      date: '@datetime',
    }]
  }

  
    
})


export default [
  {
    url: '/category/list',
    type: 'get',
    response: config => {
      const items = data.items
      return {
        code: 20000,
        data: items
      }
    }
  },

  {
    url: '/category/pagelist/[A-Za-z0-9]/[A-Za-z0-9]',
    type: 'get',
    response: config => {
      const item = data.page
      return {
        code: 20000,
        data: {
          total: item.total,
          rows: item.items
        }

      }
    }
  }
]
